//
//  ResultCollectionViewCell.m
//  Cook
//
//  Created by 0.0 on 15-4-17.
//  Copyright (c) 2015年 dingjun. All rights reserved.
//

#import "ResultCollectionViewCell.h"

@implementation ResultCollectionViewCell

- (void)dealloc
{
    [_backView release];
    [_foodImageView release];
    [_foodNameLabel release];
    [_clickLabel release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        self.backView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, self.bounds.size.width, self.bounds.size.height)];
        self.backView.backgroundColor = [UIColor whiteColor];
        
        self.foodImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_backView.bounds.origin.x + 5, _backView.bounds.origin.y + 5, _backView.frame.size.width - 10, _backView.frame.size.height - _backView.frame.size.height / 4)];

        
        self.foodNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_foodImageView.frame.origin.x, _foodImageView.frame.origin.y + _foodImageView.frame.size.height, _foodImageView.frame.size.width - _foodImageView.frame.size.width / 2.5, _foodImageView.frame.size.height / 4)];
        self.foodNameLabel.font = [UIFont systemFontOfSize:14.0f];
        
        self.clickLabel = [[UILabel alloc] initWithFrame:CGRectMake(_foodNameLabel.frame.origin.x + _foodNameLabel.frame.size.width, _foodNameLabel.frame.origin.y, _foodNameLabel.frame.size.width, _foodNameLabel.frame.size.height)];
        self.clickLabel.font = [UIFont systemFontOfSize:14.0f];
        
        
        [self.backView addSubview:_foodImageView];
        [self.backView addSubview:_foodNameLabel];
        [self.backView addSubview:_clickLabel];
        [self.contentView addSubview:_backView];
        
        [_clickLabel release];
        [_foodNameLabel release];
        [_foodImageView release];
        [_backView release];
    }
    
    return self;
}

@end
